package etc;

import java.util.Observable;

import network.Netevent;
import network.Netlistener;

public class PlayerStats extends Observable implements Netlistener {
	public int lives;
	public int cash;
	public int level;
	
	public void upd() {
		this.setChanged();
		this.notifyObservers();
	}

	@Override
	public void recieve(Netevent e) {
		if (e.cmd.equals("stat")) {
			String[] s = e.rest.split(" ");
			lives = Integer.parseInt(s[0]);
			cash = Integer.parseInt(s[1]);
			level = Integer.parseInt(s[2]);
			upd();
		}
	}
}
